﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Resto.CostControl.Core.Domain.Model;

namespace Resto.CostControl.Core.Facade.SiteModule.DataTransferObject
{
    /// <summary>
    /// 项目点成本项
    /// </summary>
    [Serializable]
    public class SiteCostItemDTO
    {
        #region 构造函数

        public SiteCostItemDTO() { }

        internal SiteCostItemDTO(SiteCostItem item)
        {
            this.ID = item.ID;
            this.ExpectedCost = item.ExpectedCost;
            this.ActualCost = item.ActualCost;
            this.ItemName = item.ItemName;
        }

        #endregion

        #region 基本属性

        public string ID { get; set; }

        /// <summary>
        /// 预计成本
        /// </summary>
        public decimal ExpectedCost { get; set; }

        /// <summary>
        /// 实际成本
        /// </summary>
        public decimal? ActualCost { get; set; }

        /// <summary>
        /// 项目名
        /// </summary>
        public string ItemName { get; set; }

        

        #endregion

        #region 方法

        internal SiteCostItem ToSiteCostItem()
        {
            SiteCostItem item = new SiteCostItem();
            CopyToSiteCostItem(item);
            return item;
        }

        internal void CopyToSiteCostItem(SiteCostItem item)
        {
            item.ItemName = this.ItemName;
            item.ExpectedCost = this.ExpectedCost;
            item.ActualCost = this.ActualCost;
        }

        #endregion
    }
}
